package com.lxb.eduservice.controller;

import com.lxb.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;


/**
 * 后台登录功能
 * @author lixuebin
 * @createTime 2022/10/20 22:51
 */
@Api(description = "后台登录功能")
@RestController
@RequestMapping("/eduservice/user")
//@CrossOrigin //跨域
public class EduLoginController {

    /**
     * 登录
     * @return
     */
    @ApiOperation("登录")
    @PostMapping("/login")
    public R login(){
        return R.ok().data("token","admin");
    }

    /**
     * 登录后返回信息
     * @return
     */
    @ApiOperation("登录后返回信息")
    @GetMapping("/info")
    public R info(){
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }
}
